import { storeToRefs } from "pinia";
import { useRouteBread } from "@/store/routebread.store.js";

function createNavGuard(router) {
  router.beforeEach((to) => {
    const store = useRouteBread();
    let { routeObj, routebreadArr, openClose, routerList } = storeToRefs(store);
    //设置活动菜单
    routeObj.value = to;
    return true;
  });
}

export { createNavGuard };
